Xbasic

*xml_document Function

Syntax

P *XML_DOCUMENT(xmltext as c)

Arguments

xmltextCharacter

A string containing XML.

Returns

resultPointer

Returns an XML parser object loaded with the XML text. See Parsing XML Documents with Xbasic.

Description

Return xml document for text.

Discussion

Creates an instance of the XML parser and loads the specified XML. The *xml_document() function can be used in place of the following Xbasic to create an XML parser to manipulate an XML document:

'Get a new instance of the XML parser
sm = xmlSchemaManager.Get()

'Load the XML file into a variable
 xml = get_from_file("c:\data\testxml.xml")

'Load the XML data into the XML parser.
'The .LoadXML() method or the .LoadUnBalancedXML() method can be used.
'If you want to parse HTML (where unbalanced tags are allowed), then the .LoadUnBalancedXML() method
'should be used
 dom = sm.LoadXML(xml)

It combines the xmlSchemaManager.Get() and sm.LoadXML(xml) steps into a single function call:

xml = get_from_file("c:\data\testxml.xml")
dom = *xml_document(xml)

See Parsing XML Documents with Xbasic for more information.

See Also